package com.jd.oneday.month3;

/**
 * 双向链表的增删改查
 * <p>
 * <p>
 * 单、双向链表的优缺点
 * 1.单向链表，查找方向只能是一个方向，而双向链表可以向前或者向后查找
 * 2.单向链表不能自我删除，需要靠辅助节点删除，而双向链表，可以自我删除
 */

public class Day13_Test {
    public static void main(String[] args) {
        Day13_LinkedListNode day13_linkedListNode1 = new Day13_LinkedListNode(1, "刘伟超", 5);
        Day13_LinkedListNode day13_linkedListNode2 = new Day13_LinkedListNode(5, "刘广超", 4);
        Day13_LinkedListNode day13_linkedListNode3 = new Day13_LinkedListNode(8, "刘满超", 14);
        Day13_LinkedListNode day13_linkedListNode4 = new Day13_LinkedListNode(15, "刘宇鹏", 7);


        Day13_DoubleLinkedList day13_doubleLinkedList = new Day13_DoubleLinkedList();
        day13_doubleLinkedList.add(day13_linkedListNode1);
        day13_doubleLinkedList.add(day13_linkedListNode2);
        day13_doubleLinkedList.add(day13_linkedListNode3);
        day13_doubleLinkedList.add(day13_linkedListNode4);


//        Day13_LinkedListNode day13_linkedListNode5 = new Day13_LinkedListNode(7, "刘龙辉", 17);
//        day13_doubleLinkedList.ByIdAdd(day13_linkedListNode5);


//        Day13_LinkedListNode day13_linkedListNode6 = new Day13_LinkedListNode(8, "刘满超超", 37);
//        day13_doubleLinkedList.update(day13_linkedListNode6);


        day13_doubleLinkedList.del(8);

        day13_doubleLinkedList.list();
    }
}
